<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <title>管理后台</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
        <!-- 新 Bootstrap 核心 CSS 文件 -->
        <link rel="stylesheet" type="text/css" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
        
        <!-- 可选的Bootstrap主题文件（一般不用引入） -->
        <link rel="stylesheet" href="//cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">

        <!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
        <script src="//cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>

        <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
        <script src="//cdn.bootcss.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
        <link href="Public/admin/css/dashboard.css" rel="stylesheet">
        
        
        <link href="Public/bootstrap/css/bootstrap-responsiv.css" rel="stylesheet">
        <link href="Public/bootstrap/css/dataTables.bootstrap.min.css" rel="stylesheet">
        
        
        
        <!-- Latest compiled and minified CSS -->
        <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.10.1/bootstrap-table.min.css">

        <!-- Latest compiled and minified JavaScript -->
        <script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.10.1/bootstrap-table.min.js"></script>

        <!-- Latest compiled and minified Locales -->
        <script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.10.1/locale/bootstrap-table-zh-CN.min.js"></script>
        
        <script src="Public/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
        <script src="Public/bootstrap-datepicker/locales/bootstrap-datepicker.zh-CN.min.js"></script>
        <link href="Public/bootstrap-datepicker/css/bootstrap-datepicker.min.css" rel="stylesheet">
        
        <script src="Public/bootstrap-datepicker/js/bootstrap-table-export.min.js"></script>
        <script src="//rawgit.com/hhurz/tableExport.jquery.plugin/master/tableExport.js"></script>
        
        <script src="Public/bootstrap-datepicker/js/bootstrap-table-filter-control.min.js"></script>
    </head>
    <body>
        <nav class="navbar navbar-inverse navbar-fixed-top">
      <div class="container-fluid">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" href="#">管理后台</a>
        </div>
        <include file="./Public/admin/navbar.html" keywords="1" />
          
      </div>
    </nav>

    <div class="container-fluid">
      <div class="row">
        <include file="./Public/admin/menu.html" keywords="2" />
        <!--正式内容开始-->
        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main ">
          
           
          <h2 class="sub-header">通告信息</h2>
          
          <div class="input-group input-daterange">
              <span class="input-group-addon">我要查询这天的数据</span>
                <input type="text" class="form-control" value="{$today|date='Y/m/d',###}" name="start">

            </div>
          <br/>
          <a class="btn btn-default submit" href="javascript:void(0)" role="button">筛选</a>
<!--          <div id="toolbar">
            <button id="button" class="btn btn-default">getOptions</button>
        </div>-->
          <table id="table"></table>
          <!--page-->
        </div>
        <!--正式内容结束-->
      </div>
    </div>
        
        
<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h4 class="modal-title" id="myModalLabel">提示</h4>
      </div>
      <div class="modal-body">
        ...
      </div>
      <div class="modal-footer" style="display: none;">
        <button type="button" class="btn btn-default" data-dismiss="modal">知道了</button>
      </div>
    </div>
  </div>
</div>
        
    </body>
        <script src="Public/bootstrap/js/jquery.dataTables.min.js" type="text/javascript" language="javascript"></script>
    <script src="Public/bootstrap/js/dataTables.bootstrap.min.js" type="text/javascript" language="javascript"></script>
    <script>
    $('#table').bootstrapTable({
    url: '?m=Center&c=Admin&a=announcement&action=getdata',
    sidePagination:'client',
    silentSort:true,
    pagination:true,
    pageSize:20,
    search:true,
    showExport:true,
    filterControl:true,
//    clickToSelect:true,
    columns: [{
        field: 'id',
        title: 'ID',
        sortable: true,
//        checkbox:true
    },{
        field: 'uid',
        title: '用户ID'
    },{
        field: 'name',
        title: '用户名'
    },{
        field: 'title',
        title: '标题',
        sortable: true,
    },{
        width:'60%',
        field: 'original_desc',
        title: '简介',
        sortable: true,
    },{
        field: 'create_time',
        title: '添加时间',
        sortable: true,
    },{
        title: '编辑',
        formatter:function(value,row,index){ 
                   var e ='';
                   if(row.level < 0){
                      e = '<a href="./index.php?m=Center&c=Admin&a=announcement&action=level&type=up&id='+row.uid+'" >'+'升级</a> | ';  
                   }else{
                      e = '<a href="./index.php?m=Center&c=Admin&a=announcement&action=level&type=down&id='+row.uid+'" >'+'降权</a> | ';    
                   }
                        
                   var d = '<a href="./index.php?m=Center&c=Admin&a=announcement&action=del&id='+row.id+'">删除</a> ';  
                        return e+d;  
        }
    }]
});

$('.input-daterange input').each(function() {
    $(this).datepicker({
        'todayHighlight':true,
        'startDate':'2015/5/5',
        'format':'yyyy/mm/dd',
        'language':'zh-CN',
        'todayBtn':true,
        'autoclose':true
    });
});

$(".submit").click(function(){
    $('#table').bootstrapTable('refresh', {url: '?m=Center&c=Admin&a=ann&action=getdata&start='+$("input[name='start']").val()});
});
    </script>
</html>
